import datetime
def notes_generator(author="", update_time="",email="", operation="create", function_illustrate="", return_illustrate ="None", para=[]):
    """
    ####################################################################################################
    #     function : read file from the input filename                                                 #
    #     return   : None                                                                              #
    #     ---------------------------------------parameter ---------------------------------------     #
    #     author : the author's name of this edit                                                      #
    #     update_time : update function's time                                                         #
    #     email : email of author                                                                      #
    #     operation : this update's operation should be "create" or "update", default is "create"      #
    #     function_illustrate : function's explaination                                                #
    #     return_illustrate : return's explaination                                                  #
    #     para : all the parameter in function                                                         #
    #     ----------------------------------------------------------------------------------------     #
    #     history :                                                                                    #
    #     huangkunyang : create   '2021-08-17'      <huangkunyang@eversec.cn>                          #
    ####################################################################################################
    """
    gap = 5
    flag = 0
    if update_time =="":
        update_time = datetime.datetime.now()
        update_time = update_time.strftime("%Y-%m-%d")
    print('"""')
    print("#" * 100)
    print("%sfunction : %s%s"  %(" "*gap, function_illustrate, " "*(100-2-gap-8-3-len(function_illustrate))))
    print("%sreturn   : %s%s"  %(" "*gap, return_illustrate, " "*(100-2-gap-8-3-len(return_illustrate))))
    if para:
        print("%s%sparameter %s%s" % (
        " " * gap, "-" * int((98 - gap * 2) / 2 - 5), "-" * int((98 - gap * 2) / 2 - 5), " " * gap))
        for parameter in para:
            print("%s%s : %s%s"%(" "*gap, parameter, " "*(100-2-gap*2-3-len(parameter))," "*gap))

    print("%s%s%s"%(" "*gap,"-"*(98-gap*2)," "*gap))
    print("%shistory : %s"%(" "*gap,         " "*(100-2-gap-3-7)))
    if operation != "update" and operation != "create":
        operation = "create"
        flag = 1
    print("     %s : %s   '%s'      <%s>  %s"     %(author, operation, update_time, email, " "*(100-2-gap-6-3-len(author+update_time+email)-15)))
    print("#" * 100)
    print('"""')

    if flag == 1:
        print("ERROR occured, unrecognised parameter entrance, parameter operation must be 'create' or 'update', please check")

if __name__ == "__main__":
    # 作者 -------------------
    author = "huangkunyang"

    # 邮箱地址 ------------------------
    email = "519462724@qq.com"

    # 函数操作（create， update） -------------------
    mode = "create"

    # 函数作用解释 ---------------------
    function_illustrate = "回测类，主要用户数据回测"

    # 返回参数解释 ------------------
    return_illustrate = "None"

    # 输入参数 --------------------------

    para = ""
    # 更新时间 ----------------------
    update_time = datetime.datetime.now().strftime(format="%Y-%m-%d")

    # 执行函数 ------------------------
    notes_generator(author, update_time, email, mode, function_illustrate, return_illustrate, para)